Skip to content

MENDELU/ORCID Authority#1261

Open
milanmajchrak wants to merge 3 commits intocustomer/mendelufrom
mendelu/ordic-redirect
Open

MENDELU/ORCID Authority#1261
milanmajchrak wants to merge 3 commits intocustomer/mendelufrom
mendelu/ordic-redirect

Conversation

@milanmajchrak
Copy link
Collaborator

Problem description

Summary

Adds ORCID profile linking for authors whose dc.contributor.author metadata has an ORCID ID in the authority field (pattern: 0000-0000-0000-0000). The author name is rendered as a clickable link to https://orcid.org/{id} with an ORCID badge icon.

Origin

Adapted from origin/vsb-tuo/orcid-enhancement (ab0100b71..13ca15b8b). Not available in upstream DSpace community.

Changes from VSB-TUO version:

  • Angular control flow syntax (@if/@for)
  • Local ORCID SVG icon instead of external URL
  • Removed VSB-TUO-specific CSS variables
  • Added encodeURIComponent for URL safety

Scope

Component Change
MetadataValuesComponent ORCID detection, URL generation, template + styling
PlainTextMetadataListElementComponent ORCID detection, URL generation, template + styling

Tests

  • MetadataValuesComponent — 10/10 passing (+5 new)
  • PlainTextMetadataListElementComponent — 7/7 passing (+5 new)

Sync verification

If en.json5 or cs.json5 translation files were updated:

  • Run yarn run sync-i18n -t src/assets/i18n/cs.json5 -i to synchronize messages, and changes are included in this PR.

Manual Testing (if applicable)

Copilot review

  • Requested review from Copilot

Copilot AI review requested due to automatic review settings March 20, 2026 13:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds ORCID profile linking UI for authority-controlled author metadata by detecting ORCID iDs in the authority field and rendering the author value as a link to https://orcid.org/{id} with an ORCID badge.

Changes:

  • Implemented ORCID authority detection + ORCID profile URL generation in MetadataValuesComponent and PlainTextMetadataListElementComponent.
  • Updated both templates to render ORCID-linked author names and a local ORCID SVG badge icon.
  • Added component styling and expanded unit tests to cover ORCID cases.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.ts Adds ORCID detection and URL generation helpers
src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.html Renders ORCID link + badge for authority-controlled ORCID values
src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.scss Adds ORCID link/badge styling for the plain-text list element
src/app/shared/object-list/metadata-representation-list-element/plain-text/plain-text-metadata-list-element.component.spec.ts Adds unit tests for ORCID detection, URL generation, and rendering
src/app/item-page/field-components/metadata-values/metadata-values.component.ts Adds ORCID detection and URL generation helpers for item page metadata values
src/app/item-page/field-components/metadata-values/metadata-values.component.html Adds ORCID template and prioritizes it during rendering
src/app/item-page/field-components/metadata-values/metadata-values.component.scss Adds ORCID link/badge styling for item page metadata values
src/app/item-page/field-components/metadata-values/metadata-values.component.spec.ts Adds unit tests for ORCID detection, URL generation, and rendering
PR_DESCRIPTION.md Adds PR documentation describing the ORCID enhancement

Comment on lines +148 to +163
isOrcidAuthority(mdValue: MetadataValue): boolean {
if (!hasValue(mdValue.authority)) {
return false;
}
const orcidPattern = /^\d{4}-\d{4}-\d{4}-\d{4}$/;
return orcidPattern.test(mdValue.authority);
}

/**
* Generates ORCID profile URL from authority ID
* @param authorityId - The ORCID authority ID
* @returns The full ORCID profile URL
*/
getOrcidUrl(authorityId: string): string {
return `https://orcid.org/${encodeURIComponent(authorityId)}`;
}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ORCID iDs can have an "X" as the final check digit; the regex ^\d{4}-\d{4}-\d{4}-\d{4}$ will reject valid ORCIDs ending in X. Update the pattern (and consider making it a shared constant since the same regex/URL is now duplicated in multiple components).

Copilot uses AI. Check for mistakes.
Comment on lines +42 to +47
const metadatum = this.mdRepresentation as MetadatumRepresentation;
if (!hasValue(metadatum.authority)) {
return false;
}
const orcidPattern = /^\d{4}-\d{4}-\d{4}-\d{4}$/;
return orcidPattern.test(metadatum.authority);
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ORCID iDs can have an "X" as the final check digit (e.g. 0000-0002-1694-233X). The current regex ^\d{4}-\d{4}-\d{4}-\d{4}$ will incorrectly return false for valid ORCID values; consider updating the pattern to allow an X in the last position (and ideally hoist the regex/base URL into shared constants to avoid duplication).

Copilot uses AI. Check for mistakes.
…source

- dso-edit-metadata-form: Fix ADD operation place handling, selective authority/confidence inclusion, language normalization
- dso-edit-metadata-authority-field: Known authority fields skip vocabulary validation, use null confidence instead of CF_UNSET, track manual changes as UPDATE
- dso-edit-metadata-field.service: Replace API-based vocabulary lookup with hardcoded authority fields list
- vocabulary.service: Add ORCID external source search for authority fields (dc.contributor.author, dc.creator, dc.contributor.editor, dc.contributor.advisor)
- dynamic-onebox.component: Skip vocabulary lookup for ORCID authority values
- form-field-metadata-value.model: Default confidence to null instead of CF_UNSET

Adapted from vsb-tuo/orcid-enhancement branch for Mendelu codebase (standalone components, @if/@for syntax).
@milanmajchrak milanmajchrak changed the title Cherry picked orcid solution from the vsb-tuo customer MENDELU/ORCID Authority Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants